import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

import audio from '@/store/modules/audio.js';
import common from '@/store/modules/common.js';

export default new Vuex.Store({
	modules: {
		audio,
		common
	},
	state: {
		shopStep:{},
		invoiceId:'',
		addressId:'',
		msgNum: 0,
		userInfo: {}, // 用户信息
		travelInfo: {}, // 旅游信息
		travelDayInfo: {}, // 旅游排期价格信息
		linkMan: {}, // 联系人
		tripMan: [], // 出行人
		cartId: '', //购物车id
		tripChild:[],// 出行儿童
		start:'', // 出发站
		end:'', // 到达站
		searchJp:{} ,// 机票搜索信息
		airDetail:{}, // 航班详情
		airPeople:[], // 乘机人
		totalPrice:0,// 总价
		orderItem:{},//订单确认信息
		audioList:[],
		recommedu:''//推荐人ID
	},
	mutations: {
		changePrice(state,val){
			state.totalPrice = val
		},
		changeShopStep(state,val){
			state.shopStep = val
		},
		changeInvoiceId(state,val){
			state.invoiceId =val
		},
		changeAddressId(state,val){
			state.addressId = val
		},
		changeAirPeople(state,val){
			state.airPeople = val
		},
		changeAirDetail(state,val){
			state.airDetail = val
		},
		changeSearchJp(state,val){
			state.searchJp = val
		},
		changeStart(state,val){
			state.start = val
		},
		changeEnd(state,val){
			state.end = val
		},
		changeChild(state,val){
			state.tripChild = val
		},
		setMsgNum(state, val) {
			state.msgNum = val
		},
		changeInfo(state, val) {
			state.userInfo = val
		},
		changeTravelInfo(state, val) {
			state.travelInfo = val
		},
		changeTravelDayInfo(state, val) {
			state.travelDayInfo = val
		},
		changeLinkman(state, val) {
			state.linkMan = val
		},
		changeTripman(state, val) {
			state.tripMan = val
		},
		changeCartId(state, val) {
			state.cartId = val
		},
		changeOrderItem(state, val) {
			state.orderItem = val
		},
		changeAudioItems(state,val){
			state.audioList = val
		},
		changeRecommedu(state,val){
			state.recommedu = val
		}
	}
})
